package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TourismRoomsMapper;
import com.ruoyi.system.domain.TourismRooms;
import com.ruoyi.system.service.ITourismRoomsService;

/**
 * 民宿房间Service业务层处理
 * 
 * @author gqd
 * @date 2020-12-29
 */
@Service
public class TourismRoomsServiceImpl implements ITourismRoomsService 
{
    @Autowired
    private TourismRoomsMapper tourismRoomsMapper;

    /**
     * 查询民宿房间
     * 
     * @param id 民宿房间ID
     * @return 民宿房间
     */
    @Override
    public TourismRooms selectTourismRoomsById(Long id)
    {
        return tourismRoomsMapper.selectTourismRoomsById(id);
    }

    /**
     * 查询民宿房间列表
     * 
     * @param tourismRooms 民宿房间
     * @return 民宿房间
     */
    @Override
    public List<TourismRooms> selectTourismRoomsList(TourismRooms tourismRooms)
    {
        return tourismRoomsMapper.selectTourismRoomsList(tourismRooms);
    }

    /**
     * 新增民宿房间
     * 
     * @param tourismRooms 民宿房间
     * @return 结果
     */
    @Override
    public int insertTourismRooms(TourismRooms tourismRooms)
    {
        tourismRooms.setCreateTime(DateUtils.getNowDate());
        return tourismRoomsMapper.insertTourismRooms(tourismRooms);
    }

    /**
     * 修改民宿房间
     * 
     * @param tourismRooms 民宿房间
     * @return 结果
     */
    @Override
    public int updateTourismRooms(TourismRooms tourismRooms)
    {
        return tourismRoomsMapper.updateTourismRooms(tourismRooms);
    }

    /**
     * 批量删除民宿房间
     * 
     * @param ids 需要删除的民宿房间ID
     * @return 结果
     */
    @Override
    public int deleteTourismRoomsByIds(Long[] ids)
    {
        return tourismRoomsMapper.deleteTourismRoomsByIds(ids);
    }

    /**
     * 删除民宿房间信息
     * 
     * @param id 民宿房间ID
     * @return 结果
     */
    @Override
    public int deleteTourismRoomsById(Long id)
    {
        return tourismRoomsMapper.deleteTourismRoomsById(id);
    }
}
